using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace tutors_clus.Models.Mapping
{
    public class teacherMap : EntityTypeConfiguration<teacher>
    {
        public teacherMap()
        {
            // Primary Key
            this.HasKey(t => t.id_tea);

            // Properties
            this.Property(t => t.id_tea)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.fullname_tea)
                .HasMaxLength(100);

            this.Property(t => t.address_tea)
                .HasMaxLength(200);

            this.Property(t => t.avatar_tea)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("teachers");
            this.Property(t => t.id_tea).HasColumnName("id_tea");
            this.Property(t => t.fullname_tea).HasColumnName("fullname_tea");
            this.Property(t => t.birthday_tea).HasColumnName("birthday_tea");
            this.Property(t => t.address_tea).HasColumnName("address_tea");
            this.Property(t => t.registered_tea).HasColumnName("registered_tea");
            this.Property(t => t.avatar_tea).HasColumnName("avatar_tea");
        }
    }
}
